<template>
  <div class="shadow" v-if="value" @click.self="$emit('input', false)">
    <div class="dialogBox">
      <span @click.self="$emit('input', false)">X</span>
      <div><slot name="header"> 请填写自定义标题 </slot></div>
      <div><slot name="content"> 自定义内容 </slot></div>
      <div><slot name="footer"> 自定义底部 </slot></div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['value'],
  emits: ['input']
}
</script>

<style lang="scss" scoped>
.shadow {
  width: 100%;
  height: 93%;
  background-color: rgba(127, 127, 127, 0.5);
  overflow: hidden;
  position: absolute;
  top: 0;
}
.dialogBox {
  width: 300px;
  height: 200px;
  background-color: white;
  margin: 150px auto;
  position: relative;

  span {
    position: absolute;
    right: 0;
    top: 0;
  }
  div {
    height: 33%;
  }
}
</style>
